import java.util.Arrays;


class Date{
    // 字段 年 月 日
    public int year;
    public int month;
    public int day;
    public int n; // 没有任何用处
    public Date(int year,int month,int day){
        this.year =year;
        this.month =month;
        this.day = day;
    }
    public Date(int year,int month,int day,int n){
        this.year = year;
        this.month = month;
        this.day  = day;
        this.n = n;
    }
    // 方法
    // 创建日期
    /*public void setDate(int y,int m,int d){
        year = y;
        month = m;
        day = d;
    }*/
//    public void setDate(int year,int month,int day){
//        year = year;
//        month = month;
//        day = day;
//    }
//    public void setDate(int year,int month,int day){
//        this.year = year;
//        this.month = month;
//        this.day = day;
//    }
    // 打印日期
    public void printDate(){
        System.out.println(year + "年" + month + "月" + day + "日");
    }
}
public class Test {
    public static void main6(String[] args) {
        Date date = new Date(2000,8,8);
        date.printDate();
        Date date1 = new Date(2000,11,11,2);
        System.out.println(date1.n);
    }
    public static void main4(String[] args) {
//        Date date1 = new Date();
//        date1.setDate(2024,11,16);
//        date1.printDate();
    }
    public static void main3(String[] args) {
//        Date date1 = new Date();
//        date1.setDate(2024,11,16);
//        date1.printDate();
//        Date date2 = new Date();
//        date2.setDate(2000,8,8);
//        date2.printDate();
//        System.out.println(date1.year);
    }
    public static void bubbleSort(int[] nums){

        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < nums.length-i-1; j++) {
                // 进行交换
                if (nums[j]>nums[j+1]){
                    int tmp = nums[j];
                    nums[j] =nums[j+1];
                    nums[j+1] = tmp;
                }
            }
        }
    }
    public static void main2(String[] args) {
        int[][] arr = {
                {1, 2, 3, 4},
                {5, 6, 7, 8},
                {9, 10, 11, 12}
        };
        for (int row = 0; row < arr.length; row++) {
            for (int col = 0; col < arr[row].length; col++) {
                System.out.printf("%d\t", arr[row][col]);
            }
            System.out.println("");
        }
    }
    public static void main(String[] args) {
        int[] nums = {3,2,6,5,4};
        System.out.println("交换前的数组:"+ Arrays.toString(nums));
        bubbleSort(nums);
        System.out.println("交换后的数组:"+Arrays.toString(nums));
        int[] arr = {3,2,6,5,8,6};
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
    }
}